package com.yyi.springcloud.controller;


import com.yyi.springcloud.entities.GroupInfoModel;
import com.yyi.springcloud.service.Local_GroupInfoService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

//传感器分组详细信息
@Controller
@RequestMapping("/mysqlapi/GroupInfo")
public class Mysql_GroupInfoController {
	@Resource
	private Local_GroupInfoService groupInfoService;

	// 查询所有的传感器分组
	// http://localhost:8080/bxxs/api/GroupInfo/getAllGroupInfoByCondition?primarykey=2017-11-1611:17:211
	@ResponseBody
	@RequestMapping(value = "/getAllGroupInfoByCondition", method = { RequestMethod.GET, RequestMethod.POST })
	public List<GroupInfoModel> getAllGroupInfoByCondition(@RequestParam(required = true) String primaryKey) {
		GroupInfoModel groupInfoModel = new GroupInfoModel();
		groupInfoModel.setPrimarykey(primaryKey);
		List<GroupInfoModel> list = groupInfoService.getAllGroupInfoByCondition(groupInfoModel);
		return list;
	}
}
